package 结对编程;


import java.io.*;
import java.util.ArrayList;

/*从我们的文件：编程项目.txt中读入文件，
 然后进行读题，再将题目进行计算，
 最后与用户输入的结果进行比对，给出正确答案，
最后给出正确率。*/
public class ReadAndJudge {
    public static void main(String[] args) throws IOException {
        Reader Readin = new FileReader("D:\\20172328lxy\\20172328lxy\\编程项目.txt");
        BufferedReader ReadIn = new BufferedReader(Readin);
        String str = ReadIn.readLine();
        ArrayList<Object> question = new ArrayList<Object>();//建立一个放我题目的列表。
        while ((str = ReadIn.readLine()) != null) {
            String[] se = str.split("\t");
            for (int i = 0; i < se.length; i++) {
                String result = "";
                if ( se[i] == "+" || se[i] == "-" || se[i] == "*" || se[i] == "÷") {
                    if (i < se.length - 8) {
                        result += se[i] + " ";
                        question.add(result);
                    }
                }
            }
            for(Object m:question)
                System.out.println(m);
        }
    }
}




